// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import zUI from './components'
// ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
// Ant-Design
import Antd from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
// MD 编辑
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
// 代码高亮
import hljs from 'highlight.js';
import 'highlight.js/styles/kimbie.light.css'	//样式
// 全局样式
import './assets/css/main.css'
// vuex
import store from '@/utils/store'
// 动态路由
import '@/router/permission'
// mock
import '../mock/mockServer'
Vue.config.productionTip = false

// vant
import Vant from 'vant';
import 'vant/lib/index.css';

Vue.use(Vant);

Vue.use(zUI)
Vue.use(ElementUI,{ size: 'small'});
Vue.use(Antd)
Vue.use(mavonEditor)
/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})


// 注册一个全局自定义指令 `v-focus`
Vue.directive('focus', {
  // 当被绑定的元素插入到 DOM 中时……
  inserted: function (el,binding) {
    // 聚焦元素
    el.focus()
  }
})
// 在需要高亮内容标签使用
Vue.directive('highlight',function (el) {
  let blocks = el.querySelectorAll('pre code');
  blocks.forEach((block)=>{
    hljs.highlightBlock(block)
  })
})
